import com.qfedu.demo.soundsystem.CompactDisc;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ApplicationSpring {

    public static void main(String[] args) {
       System.out.println("ApplicationSpring is running..");

        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext-constructor.xml");//获取配置文件

        //CompactDisc cd = context.getBean(CompactDisc.class); //这是通过类
        CompactDisc cd = (CompactDisc)context.getBean("compactDisc12");//这是通过bean中的id
        cd.play();
    }
}
